// ml:run = $bin < input
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <set>
#include <cmath>
using namespace std;
int f[20][400010], first[100010];
int seq[400010];
int fa[100010], belong[100010], dep[100010], size[100010], lca[100010];
int ne[200010], head[200010], p[200010];
int n, q, e, cnt;
int ans[2];
set<int>s[100010];
void init(){
    e=0;cnt=0;
    memset(head, -1, sizeof(head));
    memset(dep, 0, sizeof(dep));
    memset(size, 0, sizeof(size));
    memset(lca, 0, sizeof(lca));
    memset(first, 0, sizeof(first));
    for (int i=1;i<=n;i++) s[i].clear();
    ans[0]=ans[1]=0;
}
void addnote(int u, int v){
    p[e]=v;
    ne[e]=head[u];
    head[u]=e++;
}
void dfs(int x, int d, int bel){
    belong[x]=bel;
    dep[x]=d;
    seq[++cnt]=x;
    if (head[x]==-1) size[x]=1;
    for (int i=head[x];i+1;i=ne[i]){
        dfs(p[i], d+1, bel);
        seq[++cnt]=x;
        size[x]+=size[p[i]];
    }
}
int getrmq(int l, int r){
    int M=int(log2(r-l+1));
    if (dep[f[M][l]]<dep[f[M][r-(1<<M)+1]])
        return f[M][l];
    else return f[M][r-(1<<M)+1];
}
int main()
{
    //freopen("gangsters.in", "r", stdin);
    //freopen("gangsters.out", "w", stdout);
    scanf("%d%d", &n, &q);
    init();
    for (int i=2;i<=n;i++){
        scanf("%d", &fa[i]);
        addnote(fa[i], i);
    }
    seq[++cnt]=1;
    dep[1]=1;
    for (int i=head[1];i+1;i=ne[i]){
        dfs(p[i], 2, p[i]);
        size[1]+=size[p[i]];
        seq[++cnt]=1;
    }
    for (int i=1;i<=cnt;i++)
        if (first[seq[i]]==0)
            first[seq[i]]=i;
    int N=int(log2(cnt));
    for (int i=1;i<=cnt;i++) f[0][i]=seq[i];
    for (int i=1;i<=N;i++)
        for (int j=1;j+(1<<i)-1<=cnt;j++)
            if (dep[f[i-1][j]]<dep[f[i-1][j+(1<<(i-1))]])
                f[i][j]=f[i-1][j];
            else f[i][j]=f[i-1][j+(1<<(i-1))];
    char str[10];
    int x;
    for (int i=0;i<q;i++){
        scanf("%s%d", str, &x);
        if (str[0]=='+'){
            int node=belong[x];
            if (s[node].size()==0)
                ans[0]++;
            else ans[1]=ans[1]-(size[lca[node]]-s[node].size());
            s[node].insert(first[x]);
            int l=*(s[node].begin()), r=*(s[node].rbegin());
            lca[node]=getrmq(l, r);
            ans[1]=ans[1]+(size[lca[node]]-s[node].size());
        }
        else{
            int node=belong[x];
            if (s[node].size()==1)
                ans[0]--;
            ans[1]=ans[1]-(size[lca[node]]-s[node].size());
            s[node].erase(first[x]);
            if (s[node].size()>0){
                int l=*(s[node].begin()), r=*(s[node].rbegin());
                lca[node]=getrmq(l, r);
                ans[1]=ans[1]+(size[lca[node]]-s[node].size());
            }
        }
        printf("%d %d\n", ans[0], ans[1]);
    }
}

